﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Gui/masterPage.Master" AutoEventWireup="true" CodeBehind="Product.aspx.cs" Inherits="OnlineStore.Gui.Product" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="server">
    <h1>Chào Mừng ng bạn đến với Shop OnlineStore</h1>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentCenter" runat="server">
    <div>
        <h2> Hãy thỏa sức shopping online cùng shop quần áo rẻ đẹp nhé.</h2>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentTop" runat="server">
    <h1>Sản phẩm Mới nhất - Shop quần áo online</h1>
    
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MainContent" runat="server">
    <asp:DataList ID="mainlist" runat="server" CellPadding="2" CellSpacing="2" 
        RepeatColumns="4" CssClass="list">
    <ItemTemplate>
                   <a href = "/sanpham/<%#DataBinder.Eval(Container.DataItem, "id")%>">
                    <img src="../img/<%# DataBinder.Eval(Container.DataItem,"Picture")%>" title="<%# DataBinder.Eval(Container.DataItem, "Product_Name")%>" width="120" height="120" alt="<%# DataBinder.Eval(Container.DataItem, "Product_Name")%>"></a><br>
                  <div><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /><img src="../../img/special.png" /></div>
                 <a href = "/Gui/ProductDetail.aspx?id=<%#DataBinder.Eval(Container.DataItem, "id")%>"><%# DataBinder.Eval(Container.DataItem, "Product_Name")%></a><br>
                 <span style="color: #999; font-size: 11px;"><%# DataBinder.Eval(Container.DataItem, "Type")%></span><br>
                  <span style="color: #900; font-weight: bold;"><%# String.Format("{0:0,0 VNĐ}",DataBinder.Eval(Container.DataItem, "Price"))%> </span> <br>
    </ItemTemplate>
    </asp:DataList>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentButtom" runat="server">
    <div class="pagination">
        
        <%
            int num = OnlineStore.Dal.DalProduct.PageNumber;
            int page = Request.QueryString.Get("page") == null ? 1 : int.Parse(Request.QueryString.Get("page"));
        %>
        <div class="results">Hiển thị từ <%= (page-1)*num %>
         đến
         <%=(page*num <(int)Session["numberItem"])? page*num: (int) Session["numberItem"] %>
          / tổng 
          <%=(int)Session["numberItem"] %> 
          sản phẩm (<%=((int)Session["numberItem"]/OnlineStore.Dal.DalProduct.PageNumber) + 1 %> Trang)</div>
    </div>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Contentlist" runat="server">
    <div class="pagination">
    <div class="links">
        <%
            int page = Request.QueryString.Get("page") == null ? 0 : int.Parse(Request.QueryString.Get("page"));
            for (int i = 1; i <= ((int)Session["numberItem"] / OnlineStore.Dal.DalProduct.PageNumber) + 1; i++)
                if (i == page)
                {
        %>
                    <b><%=i %></b>
        <%
                }
                else
                {
         %>
                <a href=""><%=i%></a>
         <%
                }      
         %>
        </div>
        </div>
</asp:Content>
